package com.topcheer.gateway.ribbon.context;

/**
 * @author xutao
 * @Package com.topcheer.gateway.context
 * @Description: ${todo}
 * @date 2020/9/25 14:13
 */
public class RibbonFilterContextHolder {

    public static final ThreadLocal<RibbonFilterContext> CONTEXT_HOLDER =
        new InheritableThreadLocal<RibbonFilterContext>() {
            @Override
            protected RibbonFilterContext initialValue() {
                return new RibbonFilterContext();
            }
        };

    public static RibbonFilterContext getCurrentContext() {
        return CONTEXT_HOLDER.get();
    }

    public static void remove() {
        CONTEXT_HOLDER.remove();
    }
}
